﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Common.Core.Cache
{
    public abstract class CurrentSessions<T>
    {
        private static CurrentSessions<T> _session;
        public static CurrentSessions<T> Current
        {
            get {
                return _session;
            }
            set {
                _session = value;
            }
        }

        private T _obj = default(T);

        public T CurrentObj
        {
            get
            {
                return _obj;
            }
            set
            {
                _obj = value;
            }
        }

        public static T Instacn
        {
            get {
                lock (typeof(T))
                {
                    return _session._obj;
                }
            }
        }

    }
}
